package com.google.code.yargon.level;

import java.io.Serializable;

/*
 * Base class for all map blocks 
 * 
 * 
 */
public class Block implements Serializable {	
	
	private static final long serialVersionUID = -4863294328308788139L;

	// Some blocks might need to remember their coordinates
	private Location l;
	
	// Character to represent this block in ASCII
	char ch;
		
	// Block durability - scale 0 to 100, 100 being indestructible
	private int durability;
	
	/** 
	 * Set block location
	 * 
	 * @param l
	 */
	public void setLocation(Location l) {
		this.l = l;
	}
	
	/**
	 * Get block location
	 * @return
	 */
	public Location getLocation() {
		return this.l;
	}
	
	/**
	 * Set block durability
	 * 
	 * @param d
	 */
	public void setDurability(int d) {
		this.durability = d;
	}
	
	/**
	 * Get block durability
	 * 
	 * @return
	 */
	public int getDurability() {
		return this.durability;
	}
	
	/**
	 * Set the block char that represents this block in ascii, e.g. '.' for floor, '#' for wall etc.
	 * 
	 */
	public void setChar(char ch) {
		this.ch = ch;
	}
	
	/**
	 * Ge the block char that represents this block in ascii, e.g. '.' for floor, '#' for wall etc.
	 * 
	 * @return
	 */
	public char getChar() {
		return this.ch;
	}
}
